text = """
 1#include <stdio.h>
 2#include <sys/types.h>
 3#include <unistd.h>
 4#include <string.h>
 5
 6int main()
 7{
 8    int fd[2];
 9    pid_t pid;
10    char buf[1024];
11    char *data = "hello world!";
12
13    /* 创建管道 */
14    if (pipe(fd) == -1) {
15        printf("ERROR: pipe create failed!\n");
16        return -1;
17    }
18
19    pid = fork();
20    if (pid == 0) {
21        /* 子进程 */
22        close(fd[1]);   // 子进程读取数据，关闭写端
23        read(fd[0], buf, sizeof(buf));  // 从管道读数据
24        printf("child process read: %s\n", buf);
25        close(fd[0]);
26    } else if (pid > 0) {
27        /* 父进程 */
28        close(fd[0]);   //父进程写数据，关闭读端
29        write(fd[1], data, strlen(data));   // 向管道写数据
30        printf("parent process write: %s\n", data);
31        close(fd[1]);
32    }
33
34    return 0;
35}
"""

lines = text.splitlines()
for line in lines:
    print(line[2:])